﻿/*
 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved.
 */

#ifndef QCADAPTER_H
#define QCADAPTER_H

#include <windows.h>
#include <QtCore/qglobal.h>
#include <QtCore/QString>
#include <QtCore/QVector>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QTime>

// Basic types
struct Position {};
using POSITION = Position *;

using CQCPtr = void *;

#define BEFORE_START_POSITION ((POSITION)-1L)

#define CHECK_CONDITION(f) // assert(f)
#define TRACE(a)

#ifndef qcmax
#define QCMAX(a, b) (((a) > (b)) ? (a) : (b))
#endif

#ifndef qcmin
#define QCMIN(a, b) (((a) < (b)) ? (a) : (b))
#endif

#ifdef UNICODE
#define TCHAR_TO_Q_STRING(x) QString::fromWCharArray((x))
#define TCHAR_TO_Q_STRING_N(x, y) QString::fromWCharArray((x), (y))
#else
#define Q_STRING_TO_TCHAR(x) (x).toLocal8Bit().constData()
#define PQ_STRING_TO_TCHAR(x) (x)->toLocal8Bit().constData()
#define TCHAR_TO_Q_STRING(x) QString::fromLocal8Bit((x))
#define TCHAR_TO_Q_STRING_N(x, y) QString::fromLocal8Bit((x), (y))
#endif

template <typename T>
struct HSODummyDeleter {
    void operator()(T* p)
    {
        UNREFERENCED_PARAMETER(p);
    }
};

#endif // __QCADAPTER_H__
